3.2.11 \(\int \frac {\text {sech}^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx\) [111]

3.2.11.1 Optimal result
3.2.11.2 Mathematica [A] (verified)
3.2.11.3 Rubi [A] (verified)
3.2.11.4 Maple [C] (verified)
3.2.11.5 Fricas [B] (verification not implemented)
3.2.11.6 Sympy [F]
3.2.11.7 Maxima [F]
3.2.11.8 Giac [F]
3.2.11.9 Mupad [B] (verification not implemented)

3.2.11.1 Optimal result

Integrand size = 23, antiderivative size = 55 \[ \int \frac {\text {sech}^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=-\frac {\arctan (\sinh (c+d x))}{b d}+\frac {\sqrt {a+b} \arctan \left (\frac {\sqrt {a+b} \sinh (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} b d} \]

output
-arctan(sinh(d*x+c))/b/d+arctan(sinh(d*x+c)*(a+b)^(1/2)/a^(1/2))*(a+b)^(1/ 
2)/b/d/a^(1/2)
 
3.2.11.2 Mathematica [A] (verified)

Time = 0.31 (sec) , antiderivative size = 55, normalized size of antiderivative = 1.00 \[ \int \frac {\text {sech}^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=-\frac {\frac {\sqrt {a+b} \arctan \left (\frac {\sqrt {a} \text {csch}(c+d x)}{\sqrt {a+b}}\right )}{\sqrt {a}}+2 \arctan \left (\tanh \left (\frac {1}{2} (c+d x)\right )\right )}{b d} \]

input
Integrate[Sech[c + d*x]^3/(a + b*Tanh[c + d*x]^2),x]
 
output
-(((Sqrt[a + b]*ArcTan[(Sqrt[a]*Csch[c + d*x])/Sqrt[a + b]])/Sqrt[a] + 2*A 
rcTan[Tanh[(c + d*x)/2]])/(b*d))
 
3.2.11.3 Rubi [A] (verified)

Time = 0.26 (sec) , antiderivative size = 53, normalized size of antiderivative = 0.96, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3042, 4159, 303, 216, 218}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\text {sech}^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\sec (i c+i d x)^3}{a-b \tan (i c+i d x)^2}dx\)

\(\Big \downarrow \) 4159

\(\displaystyle \frac {\int \frac {1}{\left (\sinh ^2(c+d x)+1\right ) \left ((a+b) \sinh ^2(c+d x)+a\right )}d\sinh (c+d x)}{d}\)

\(\Big \downarrow \) 303

\(\displaystyle \frac {\frac {(a+b) \int \frac {1}{(a+b) \sinh ^2(c+d x)+a}d\sinh (c+d x)}{b}-\frac {\int \frac {1}{\sinh ^2(c+d x)+1}d\sinh (c+d x)}{b}}{d}\)

\(\Big \downarrow \) 216

\(\displaystyle \frac {\frac {(a+b) \int \frac {1}{(a+b) \sinh ^2(c+d x)+a}d\sinh (c+d x)}{b}-\frac {\arctan (\sinh (c+d x))}{b}}{d}\)

\(\Big \downarrow \) 218

\(\displaystyle \frac {\frac {\sqrt {a+b} \arctan \left (\frac {\sqrt {a+b} \sinh (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} b}-\frac {\arctan (\sinh (c+d x))}{b}}{d}\)

input
Int[Sech[c + d*x]^3/(a + b*Tanh[c + d*x]^2),x]
 
output
(-(ArcTan[Sinh[c + d*x]]/b) + (Sqrt[a + b]*ArcTan[(Sqrt[a + b]*Sinh[c + d* 
x])/Sqrt[a]])/(Sqrt[a]*b))/d
 

3.2.11.3.1 Defintions of rubi rules used

rule 216
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A 
rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a 
, 0] || GtQ[b, 0])
 

rule 218
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R 
t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
 

rule 303
Int[1/(((a_) + (b_.)*(x_)^2)*((c_) + (d_.)*(x_)^2)), x_Symbol] :> Simp[b/(b 
*c - a*d)   Int[1/(a + b*x^2), x], x] - Simp[d/(b*c - a*d)   Int[1/(c + d*x 
^2), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4159
Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_ 
))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Sin[e + f*x], x]}, Simp[ff/f 
  Subst[Int[ExpandToSum[b*(ff*x)^n + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 - ff^2 
*x^2)^((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f} 
, x] && IntegerQ[(m - 1)/2] && IntegerQ[n/2] && IntegerQ[p]
 
3.2.11.4 Maple [C] (verified)

Result contains complex when optimal does not.

Time = 8.71 (sec) , antiderivative size = 144, normalized size of antiderivative = 2.62

method result size
risch \(\frac {i \ln \left ({\mathrm e}^{d x +c}-i\right )}{d b}-\frac {i \ln \left ({\mathrm e}^{d x +c}+i\right )}{d b}+\frac {\sqrt {-a \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 d x +2 c}+\frac {2 \sqrt {-a \left (a +b \right )}\, {\mathrm e}^{d x +c}}{a +b}-1\right )}{2 a d b}-\frac {\sqrt {-a \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 d x +2 c}-\frac {2 \sqrt {-a \left (a +b \right )}\, {\mathrm e}^{d x +c}}{a +b}-1\right )}{2 a d b}\) \(144\)
derivativedivides \(\frac {\frac {2 a \left (a +b \right ) \left (\frac {\left (\sqrt {\left (a +b \right ) b}+b \right ) \arctan \left (\frac {a \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (2 \sqrt {\left (a +b \right ) b}+a +2 b \right ) a}}\right )}{2 a \sqrt {\left (a +b \right ) b}\, \sqrt {\left (2 \sqrt {\left (a +b \right ) b}+a +2 b \right ) a}}-\frac {\left (\sqrt {\left (a +b \right ) b}-b \right ) \operatorname {arctanh}\left (\frac {a \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (2 \sqrt {\left (a +b \right ) b}-a -2 b \right ) a}}\right )}{2 a \sqrt {\left (a +b \right ) b}\, \sqrt {\left (2 \sqrt {\left (a +b \right ) b}-a -2 b \right ) a}}\right )}{b}-\frac {2 \arctan \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b}}{d}\) \(175\)
default \(\frac {\frac {2 a \left (a +b \right ) \left (\frac {\left (\sqrt {\left (a +b \right ) b}+b \right ) \arctan \left (\frac {a \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (2 \sqrt {\left (a +b \right ) b}+a +2 b \right ) a}}\right )}{2 a \sqrt {\left (a +b \right ) b}\, \sqrt {\left (2 \sqrt {\left (a +b \right ) b}+a +2 b \right ) a}}-\frac {\left (\sqrt {\left (a +b \right ) b}-b \right ) \operatorname {arctanh}\left (\frac {a \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (2 \sqrt {\left (a +b \right ) b}-a -2 b \right ) a}}\right )}{2 a \sqrt {\left (a +b \right ) b}\, \sqrt {\left (2 \sqrt {\left (a +b \right ) b}-a -2 b \right ) a}}\right )}{b}-\frac {2 \arctan \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b}}{d}\) \(175\)

input
int(sech(d*x+c)^3/(a+b*tanh(d*x+c)^2),x,method=_RETURNVERBOSE)
 
output
I/d/b*ln(exp(d*x+c)-I)-I/d/b*ln(exp(d*x+c)+I)+1/2/a*(-a*(a+b))^(1/2)/d/b*l 
n(exp(2*d*x+2*c)+2*(-a*(a+b))^(1/2)/(a+b)*exp(d*x+c)-1)-1/2/a*(-a*(a+b))^( 
1/2)/d/b*ln(exp(2*d*x+2*c)-2*(-a*(a+b))^(1/2)/(a+b)*exp(d*x+c)-1)
 
3.2.11.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 171 vs. \(2 (47) = 94\).

Time = 0.29 (sec) , antiderivative size = 540, normalized size of antiderivative = 9.82 \[ \int \frac {\text {sech}^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\left [\frac {\sqrt {-\frac {a + b}{a}} \log \left (\frac {{\left (a + b\right )} \cosh \left (d x + c\right )^{4} + 4 \, {\left (a + b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (a + b\right )} \sinh \left (d x + c\right )^{4} - 2 \, {\left (3 \, a + b\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, {\left (a + b\right )} \cosh \left (d x + c\right )^{2} - 3 \, a - b\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{3} - {\left (3 \, a + b\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + 4 \, {\left (a \cosh \left (d x + c\right )^{3} + 3 \, a \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{2} + a \sinh \left (d x + c\right )^{3} - a \cosh \left (d x + c\right ) + {\left (3 \, a \cosh \left (d x + c\right )^{2} - a\right )} \sinh \left (d x + c\right )\right )} \sqrt {-\frac {a + b}{a}} + a + b}{{\left (a + b\right )} \cosh \left (d x + c\right )^{4} + 4 \, {\left (a + b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (a + b\right )} \sinh \left (d x + c\right )^{4} + 2 \, {\left (a - b\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, {\left (a + b\right )} \cosh \left (d x + c\right )^{2} + a - b\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{3} + {\left (a - b\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + a + b}\right ) - 4 \, \arctan \left (\cosh \left (d x + c\right ) + \sinh \left (d x + c\right )\right )}{2 \, b d}, \frac {\sqrt {\frac {a + b}{a}} \arctan \left (\frac {1}{2} \, \sqrt {\frac {a + b}{a}} {\left (\cosh \left (d x + c\right ) + \sinh \left (d x + c\right )\right )}\right ) + \sqrt {\frac {a + b}{a}} \arctan \left (\frac {{\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{3} + 3 \, {\left (a + b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{2} + {\left (a + b\right )} \sinh \left (d x + c\right )^{3} + {\left (3 \, a - b\right )} \cosh \left (d x + c\right ) + {\left (3 \, {\left (a + b\right )} \cosh \left (d x + c\right )^{2} + 3 \, a - b\right )} \sinh \left (d x + c\right )\right )} \sqrt {\frac {a + b}{a}}}{2 \, {\left (a + b\right )}}\right ) - 2 \, \arctan \left (\cosh \left (d x + c\right ) + \sinh \left (d x + c\right )\right )}{b d}\right ] \]

input
integrate(sech(d*x+c)^3/(a+b*tanh(d*x+c)^2),x, algorithm="fricas")
 
output
[1/2*(sqrt(-(a + b)/a)*log(((a + b)*cosh(d*x + c)^4 + 4*(a + b)*cosh(d*x + 
 c)*sinh(d*x + c)^3 + (a + b)*sinh(d*x + c)^4 - 2*(3*a + b)*cosh(d*x + c)^ 
2 + 2*(3*(a + b)*cosh(d*x + c)^2 - 3*a - b)*sinh(d*x + c)^2 + 4*((a + b)*c 
osh(d*x + c)^3 - (3*a + b)*cosh(d*x + c))*sinh(d*x + c) + 4*(a*cosh(d*x + 
c)^3 + 3*a*cosh(d*x + c)*sinh(d*x + c)^2 + a*sinh(d*x + c)^3 - a*cosh(d*x 
+ c) + (3*a*cosh(d*x + c)^2 - a)*sinh(d*x + c))*sqrt(-(a + b)/a) + a + b)/ 
((a + b)*cosh(d*x + c)^4 + 4*(a + b)*cosh(d*x + c)*sinh(d*x + c)^3 + (a + 
b)*sinh(d*x + c)^4 + 2*(a - b)*cosh(d*x + c)^2 + 2*(3*(a + b)*cosh(d*x + c 
)^2 + a - b)*sinh(d*x + c)^2 + 4*((a + b)*cosh(d*x + c)^3 + (a - b)*cosh(d 
*x + c))*sinh(d*x + c) + a + b)) - 4*arctan(cosh(d*x + c) + sinh(d*x + c)) 
)/(b*d), (sqrt((a + b)/a)*arctan(1/2*sqrt((a + b)/a)*(cosh(d*x + c) + sinh 
(d*x + c))) + sqrt((a + b)/a)*arctan(1/2*((a + b)*cosh(d*x + c)^3 + 3*(a + 
 b)*cosh(d*x + c)*sinh(d*x + c)^2 + (a + b)*sinh(d*x + c)^3 + (3*a - b)*co 
sh(d*x + c) + (3*(a + b)*cosh(d*x + c)^2 + 3*a - b)*sinh(d*x + c))*sqrt((a 
 + b)/a)/(a + b)) - 2*arctan(cosh(d*x + c) + sinh(d*x + c)))/(b*d)]
 
3.2.11.6 Sympy [F]

\[ \int \frac {\text {sech}^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\int \frac {\operatorname {sech}^{3}{\left (c + d x \right )}}{a + b \tanh ^{2}{\left (c + d x \right )}}\, dx \]

input
integrate(sech(d*x+c)**3/(a+b*tanh(d*x+c)**2),x)
 
output
Integral(sech(c + d*x)**3/(a + b*tanh(c + d*x)**2), x)
 
3.2.11.7 Maxima [F]

\[ \int \frac {\text {sech}^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\int { \frac {\operatorname {sech}\left (d x + c\right )^{3}}{b \tanh \left (d x + c\right )^{2} + a} \,d x } \]

input
integrate(sech(d*x+c)^3/(a+b*tanh(d*x+c)^2),x, algorithm="maxima")
 
output
-2*arctan(e^(d*x + c))/(b*d) + 8*integrate(1/4*((a*e^(3*c) + b*e^(3*c))*e^ 
(3*d*x) + (a*e^c + b*e^c)*e^(d*x))/(a*b + b^2 + (a*b*e^(4*c) + b^2*e^(4*c) 
)*e^(4*d*x) + 2*(a*b*e^(2*c) - b^2*e^(2*c))*e^(2*d*x)), x)
 
3.2.11.8 Giac [F]

\[ \int \frac {\text {sech}^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\int { \frac {\operatorname {sech}\left (d x + c\right )^{3}}{b \tanh \left (d x + c\right )^{2} + a} \,d x } \]

input
integrate(sech(d*x+c)^3/(a+b*tanh(d*x+c)^2),x, algorithm="giac")
 
output
sage0*x
 
3.2.11.9 Mupad [B] (verification not implemented)

Time = 2.30 (sec) , antiderivative size = 449, normalized size of antiderivative = 8.16 \[ \int \frac {\text {sech}^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\frac {\sqrt {a+b}\,\left (2\,\mathrm {atan}\left (\frac {{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c\,\sqrt {a+b}\,\sqrt {a\,b^2\,d^2}}{2\,a\,b\,d}\right )-2\,\mathrm {atan}\left (\frac {\left ({\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c\,\left (\frac {64\,\left (2\,a\,b^2\,d\,\sqrt {a+b}-6\,a^2\,b\,d\,\sqrt {a+b}\right )}{a^3\,b^3\,d^2\,{\left (a+b\right )}^2\,\left (a^2+2\,a\,b+b^2\right )}+\frac {32\,\left (3\,a^2\,\sqrt {a\,b^2\,d^2}-b^2\,\sqrt {a\,b^2\,d^2}+2\,a\,b\,\sqrt {a\,b^2\,d^2}\right )}{a^3\,b^2\,d\,{\left (a+b\right )}^{3/2}\,\left (a^2+2\,a\,b+b^2\right )\,\sqrt {a\,b^2\,d^2}}\right )-\frac {32\,{\mathrm {e}}^{3\,c}\,{\mathrm {e}}^{3\,d\,x}\,\left (3\,a^2\,\sqrt {a\,b^2\,d^2}-b^2\,\sqrt {a\,b^2\,d^2}+2\,a\,b\,\sqrt {a\,b^2\,d^2}\right )}{a^3\,b^2\,d\,{\left (a+b\right )}^{3/2}\,\left (a^2+2\,a\,b+b^2\right )\,\sqrt {a\,b^2\,d^2}}\right )\,\left (a^4\,b\,\left (a+b\right )\,\sqrt {a\,b^2\,d^2}+a^2\,b^3\,\left (a+b\right )\,\sqrt {a\,b^2\,d^2}+2\,a^3\,b^2\,\left (a+b\right )\,\sqrt {a\,b^2\,d^2}\right )}{192\,a-64\,b}\right )\right )}{2\,\sqrt {a\,b^2\,d^2}}-\frac {2\,\mathrm {atan}\left (\frac {{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c\,\left (9\,a^2\,\sqrt {b^2\,d^2}+b^2\,\sqrt {b^2\,d^2}-6\,a\,b\,\sqrt {b^2\,d^2}\right )}{9\,d\,a^2\,b-6\,d\,a\,b^2+d\,b^3}\right )}{\sqrt {b^2\,d^2}} \]

input
int(1/(cosh(c + d*x)^3*(a + b*tanh(c + d*x)^2)),x)
 
output
((a + b)^(1/2)*(2*atan((exp(d*x)*exp(c)*(a + b)^(1/2)*(a*b^2*d^2)^(1/2))/( 
2*a*b*d)) - 2*atan(((exp(d*x)*exp(c)*((64*(2*a*b^2*d*(a + b)^(1/2) - 6*a^2 
*b*d*(a + b)^(1/2)))/(a^3*b^3*d^2*(a + b)^2*(2*a*b + a^2 + b^2)) + (32*(3* 
a^2*(a*b^2*d^2)^(1/2) - b^2*(a*b^2*d^2)^(1/2) + 2*a*b*(a*b^2*d^2)^(1/2)))/ 
(a^3*b^2*d*(a + b)^(3/2)*(2*a*b + a^2 + b^2)*(a*b^2*d^2)^(1/2))) - (32*exp 
(3*c)*exp(3*d*x)*(3*a^2*(a*b^2*d^2)^(1/2) - b^2*(a*b^2*d^2)^(1/2) + 2*a*b* 
(a*b^2*d^2)^(1/2)))/(a^3*b^2*d*(a + b)^(3/2)*(2*a*b + a^2 + b^2)*(a*b^2*d^ 
2)^(1/2)))*(a^4*b*(a + b)*(a*b^2*d^2)^(1/2) + a^2*b^3*(a + b)*(a*b^2*d^2)^ 
(1/2) + 2*a^3*b^2*(a + b)*(a*b^2*d^2)^(1/2)))/(192*a - 64*b))))/(2*(a*b^2* 
d^2)^(1/2)) - (2*atan((exp(d*x)*exp(c)*(9*a^2*(b^2*d^2)^(1/2) + b^2*(b^2*d 
^2)^(1/2) - 6*a*b*(b^2*d^2)^(1/2)))/(b^3*d - 6*a*b^2*d + 9*a^2*b*d)))/(b^2 
*d^2)^(1/2)